package com.agou.app.admin.business.develop.action;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.agou.app.admin.dbconfig.bean.TSProject;
import com.agou.core.ss.SSException;
import com.agou.core.ss.SSTrace;
import com.agou.ssh.core.base.BOResultSet;
import com.opensymphony.xwork2.Action;

public class DevelopAjaxAction extends IDevelopAjaxAction {
	private static final long serialVersionUID = -8357180487207298194L;
	private static SSTrace ssTrace = SSTrace.getInstance(DevelopAction.class);
	
	/** ***********输出参数************* **/
	private List<Map<String, String>> datalist = new ArrayList<Map<String, String>>();


	public List<Map<String, String>> getDatalist() {
		return datalist;
	}


	public void setDatalist(List<Map<String, String>> datalist) {
		this.datalist = datalist;
	}


	//查询项目列表
	public String queryProject() throws SSException, SQLException, IOException {
		try {
			ssTrace.debug("userRegister", "查询项目列表：#0", this.getDevelopVo());
			this.jdbcBeging(true, true);// 设置使用事务，并且自动管理
			this.getDevelopBo().setJdbcSession(this.getJdbcSession());
			BOResultSet boResultSet = this.getDevelopBo().queryProject(developVo);
			List<Object> tlist = boResultSet.getDataList();
			List<Map<String,String>> valueList = new ArrayList<Map<String,String>>();
			Map<String,String> valueMap;
			TSProject voValue;
			for(int i = 0 ; i < tlist.size() ; i++){
				valueMap = new HashMap<String,String>();
				voValue = (TSProject)tlist.get(i);
				valueMap.put("projectId",String.valueOf(voValue.getProjectId()));
				valueMap.put("projectName", voValue.getProjectName());
				valueMap.put("projectDesc", voValue.getProjectDesc());
				valueMap.put("showTitle", voValue.getShowTitle());
				valueMap.put("projectUrl", voValue.getProjectUrl());
				valueMap.put("createDate", voValue.getCreateDate().format());
				valueList.add(valueMap);
			}//end for
			this.setDatalist(valueList);
			return Action.SUCCESS;// 完成
		} finally {
		}
	}
}
